//@dart=2.12
import 'package:base_flutter/base_flutter.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:ls_work/bad_event/bad_event_ext.dart';
import 'package:ls_work/bad_event/ui/elder_fall_event_page.dart';
import 'package:ls_work/util/ext_utils.dart';

import '../../res/colors.dart';
import '../../res/gaps.dart';
import '../../widgets/common_widget.dart';
import '../../widgets/event_input_widget.dart';
import '../view_model/fall_event_detail_view_model.dart';
import 'bad_event_list_page.dart';

class FallEventDetailPage extends BaseStatefulMvvmWidget {
  dynamic eventId;

  FallEventDetailPage({required this.eventId});

  @override
  State<StatefulWidget> createState() => _FallEventDetailState();
}

class _FallEventDetailState
    extends BaseMvvmState<FallEventDetailViewModel, FallEventDetailPage> {
  Widget get arrowRight => Container();

  @override
  Widget? buildLoadingContentView() {
    var detail = viewModel.eventDetail;

    ///跌倒
    return Column(
      children: [
        if (detail?.eventType == 1) elderFallDetail().setWeight(1),
        if (detail?.eventType == 4||detail?.eventType==5) medicineEventDetail().setWeight(1),
        if (detail?.archivingStatus == 0) ...[
          Row(
            children: [
              TextButton(
                onPressed: () {
                  viewModel.cancelEvent();
                },
                child: CommonText('作废', textColor: Colors.white),
                style: TextButton.styleFrom(
                    shape: RoundedRectangleBorder(borderRadius: 6.borderRadius),
                    backgroundColor: Colors.red,
                    minimumSize: Size.fromHeight(44)),
              ).setWeight(1),
              TextButton(
                onPressed: () {
                  viewModel.toChangePage();
                },
                child: CommonText('修改', textColor: Colors.white),
                style: badEventButtonStyle,
              ).setWeight(1),
              TextButton(
                onPressed: () {
                  viewModel.eventArchiving();
                },
                child: CommonText('归档', textColor: Colors.white),
                style: TextButton.styleFrom(
                    shape: RoundedRectangleBorder(borderRadius: 6.borderRadius),
                    backgroundColor: Colors.orange,
                    minimumSize: Size.fromHeight(44)),
              ).setWeight(1)
            ].insertWidget(SizedBox(
              width: 12,
            )),
          ).addToContainer(
            margin: EdgeInsets.symmetric(horizontal: 12),
          ),
          SizedBox(
            height: 34,
          )
        ]
      ],
    );
  }

  Widget elderFallDetail() {
    var detail = viewModel.eventDetail;
    return SingleChildScrollView(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          SizedBox(
            height: 8,
          ),
          Column(
            children: [
              TitleValueWidget(
                  title: '长者姓名',
                  value: detail?.customerName ?? "",
                  hint: '',
                  isRequired: true,
                  contentWeight: -1,
                  arrow: arrowRight),
              TitleValueWidget(
                title: '床位号',
                value: detail?.bedNo ?? "",
                hint: '根据老人自动显示',
                contentWeight: -1,
              ),
              TitleValueWidget(
                title: '性别',
                value: detail?.sexName ?? "",
                hint: '根据老人自动显示',
                contentWeight: -1,
              ),
              TitleValueWidget(
                  title: '发生时间',
                  value: detail?.occurrenceTime ?? "",
                  contentWeight: -1,
                  arrow: arrowRight),
              TitleValueWidget(
                  title: '事发时意识状态',
                  value: detail?.qualityAnomalousEvent?.consciousState ?? "",
                  hint: '',
                  contentWeight: -1,
                  arrow: arrowRight),
              Column(
                children: [
                  TitleValueWidget(
                      title: '入住时是否为跌倒危险群',
                      value:
                          detail?.qualityAnomalousEvent?.falldownHighRishName ??
                              "",
                      hint: '',
                      contentWeight: -1,
                      arrow: arrowRight),
                  if (!(detail?.qualityAnomalousEvent?.screenItem ?? "")
                      .isEmpty) ...[
                    CommonText(detail?.qualityAnomalousEvent?.screenItem ?? "")
                        .addToContainer(
                            width: double.infinity,
                            decoration: BoxDecoration(
                                color: Color(0xfff7f7f7),
                                borderRadius: 3.borderRadius),
                            padding: EdgeInsets.symmetric(
                                horizontal: 16, vertical: 12)),
                    SizedBox(
                      height: 14,
                    )
                  ]
                ],
              ),
              TitleValueWidget(
                  title: '长者活动性',
                  value: detail?.qualityAnomalousEvent?.activityAnalyze
                      .activityAnalyzeName,
                  hint: '',
                  contentWeight: 1,
                  arrow: arrowRight),
              TitleInputWidget(
                title: '诊断',
                hint: '',
                text: detail?.qualityAnomalousEvent?.diagnose ?? "",
                inEdit: false,
              ),
              TitleValueWidget(
                  title: '发生地点',
                  value: detail?.qualityAnomalousEvent?.falldownLocationType
                      .locationName,
                  hint: '',
                  contentWeight: -1,
                  isRequired: true,
                  arrow: arrowRight),
              TitleValueWidget(
                  title: '跌倒描述人',
                  value: detail?.qualityAnomalousEvent?.qualityBy
                      ?.comboDataName((viewModel.comboListMap['400004'] ?? [])),
                  hint: '',
                  contentWeight: -1,
                  isRequired: false,
                  arrow: arrowRight),
              TitleInputWidget(
                title: '跌倒描述人姓名',
                text: detail?.qualityAnomalousEvent?.foundName ?? "",
                isRow: true,
                inEdit: false,
                hint: '',
              ),
              TitleInputWidget(
                title: '跌倒描述人职位',
                text: detail?.qualityAnomalousEvent?.foundPosts ?? "",
                isRow: true,
                inEdit: false,
                hint: '',
              ),
              TitleInputWidget(
                  title: '长辈情况',
                  isRow: true,
                  hint: '',
                  inEdit: false,
                  text:
                      detail?.qualityAnomalousEvent?.circumstanceRemark ?? ""),
              TitleInputWidget(
                title: '本次跌倒事件为本次入住中第几次跌倒',
                isRow: true,
                titleWeight: 3,
                contentWeight: 1,
                inEdit: false,
                hint: '',
                text: detail?.qualityAnomalousEvent?.falldownTimes
                        ?.toStringOrNull() ??
                    "",
              ),
              TitleInputWidget(
                title: '事件说明（含时间前因及背景描述）',
                isRequired: true,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.eventDescription ?? "",
                hint: '',
              ),
              TitleInputWidget(
                title: '处理情形（含通报主管）',
                isRequired: true,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.processDescription ?? "",
                hint: '',
              ),
              TitleValueWidget(
                  title: '发生于下列何种活动过程中',
                  value: detail?.qualityAnomalousEvent?.occurrenceActivityType
                      ?.comboDataName((viewModel.comboListMap['97'] ?? [])),
                  hint: '',
                  contentWeight: -1,
                  isRequired: false,
                  arrow: arrowRight),
              TitleValueWidget(
                  title: '下床（或移动）动机为何',
                  value: detail?.qualityAnomalousEvent?.motivationType
                      ?.comboDataName((viewModel.comboListMap['96'] ?? [])),
                  hint: '',
                  contentWeight: -1,
                  isRequired: false,
                  arrow: arrowRight),
              TitleValueWidget(
                  title: '事件发生时是否已使用床栏的保护',
                  value: detail
                      ?.qualityAnomalousEvent?.bedrailUsage?.bedrailUsageName,
                  hint: '',
                  contentWeight: -1,
                  isRequired: false,
                  arrow: arrowRight),
              TitleValueWidget(
                  title: '跌倒前是否事先建立【高危险性上-跌倒】的护理计划',
                  value:
                      detail?.qualityAnomalousEvent?.preventiveAction?.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '事件发生前是否给予【预防跌倒】宣教或说明',
                  value:
                      detail?.qualityAnomalousEvent?.preventiveAction?.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              Column(
                children: [
                  SizedBox(
                    height: 15,
                  ),
                  CommonText('跌倒事件发生前24小时内，若曾使用下联何种药物请填上药名',
                      textColor: Colours.text_dark),
                  SizedBox(
                    height: 15,
                  ),
                  ...[
                    CheckInputWidget(
                      title: '镇静安眠药',
                      hint: '',
                      text: detail?.qualityAnomalousEvent?.sedativeName ?? "",
                      enable: false,
                      inEdit: false,
                      isChecked:
                          detail?.qualityAnomalousEvent?.useSedative == 1,
                    ),
                    CheckInputWidget(
                      title: '抗组织胺',
                      hint: '',
                      text: detail?.qualityAnomalousEvent?.antihistamineName ??
                          "",
                      enable: false,
                      inEdit: false,
                      isChecked:
                          detail?.qualityAnomalousEvent?.useAntihistamine == 1,
                    ),
                    CheckInputWidget(
                      title: '心血管用药',
                      hint: '',
                      text:
                          detail?.qualityAnomalousEvent?.angiomyocardiacName ??
                              "",
                      enable: false,
                      inEdit: false,
                      isChecked:
                          detail?.qualityAnomalousEvent?.useAngiomyocardiac ==
                              1,
                    ),
                    CheckInputWidget(
                      title: '麻醉药/止疼剂',
                      hint: '',
                      text: detail?.qualityAnomalousEvent?.analgeticName ?? "",
                      enable: false,
                      inEdit: false,
                      isChecked:
                          detail?.qualityAnomalousEvent?.useAnalgetic == 1,
                    ),
                    CheckInputWidget(
                      title: '轻泻剂',
                      hint: '',
                      text: detail?.qualityAnomalousEvent?.aperientName ?? "",
                      enable: false,
                      inEdit: false,
                      isChecked:
                          detail?.qualityAnomalousEvent?.useAperient == 1,
                    ),
                    CheckInputWidget(
                      title: '利尿剂',
                      hint: '',
                      text: detail?.qualityAnomalousEvent?.diuretic ?? "",
                      enable: false,
                      inEdit: false,
                      isChecked:
                          detail?.qualityAnomalousEvent?.useDiuretic == 1,
                    ),
                    CheckInputWidget(
                      title: '其他药物',
                      hint: '',
                      text: detail?.qualityAnomalousEvent?.otherMedicineName ??
                          "",
                      enable: false,
                      inEdit: false,
                      isChecked:
                          detail?.qualityAnomalousEvent?.useOtherMedicine == 1,
                    ),
                  ].insertWidget(Container(
                    height: 1,
                    color: Colours.line,
                    margin: EdgeInsets.symmetric(vertical: 5),
                  ))
                ],
              ),
              TitleValueWidget(
                  title: '跌倒前的体位',
                  value: detail
                      ?.qualityAnomalousEvent?.bodyPositionBeforeFallingType
                      ?.comboDataName((viewModel.comboListMap['44263'] ?? [])),
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '辅具/环境',
                  value: detail
                      ?.qualityAnomalousEvent?.accessoriesOrEnvironmentType
                      ?.comboDataName((viewModel.comboListMap['5878'] ?? [])),
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '跌倒前的约束状态',
                  value: detail?.qualityAnomalousEvent
                      ?.constraintStatusBeforeFalling?.yesOrNo,
                  hint: '请选择',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '穿鞋情况',
                  value: detail
                      ?.qualityAnomalousEvent?.wearingShoesSituationType
                      ?.comboDataName((viewModel.comboListMap['4319'] ?? [])),
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '辅具',
                  value: detail?.qualityAnomalousEvent?.accessories
                      ?.equipmentName(viewModel.equipmentList),
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '视力辅具',
                  value:
                      detail?.qualityAnomalousEvent?.visionAccessories?.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '助听器',
                  value: detail?.qualityAnomalousEvent?.hearingAids?.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '告知家属',
                  value: detail?.qualityAnomalousEvent?.informFamilies?.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '已通知医生',
                  value: detail?.qualityAnomalousEvent?.informDoctor?.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '已通知护士',
                  value: detail?.qualityAnomalousEvent?.informNurse?.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '打急救电话',
                  value: detail
                      ?.qualityAnomalousEvent?.callEmergencyNumber?.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '跌倒时有无陪伴',
                  value:
                      detail?.qualityAnomalousEvent?.fallAccompany?.haveOrNot,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '跌倒外在因素',
                  value: detail?.qualityAnomalousEvent?.fallFactor
                      ?.comboDataName((viewModel.comboListMap['400006'] ?? [])),
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '通知医生时间',
                  value: detail?.qualityAnomalousEvent?.doctorDate ?? "",
                  hint: '',
                  contentWeight: -1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '通知护士时间',
                  value: detail?.qualityAnomalousEvent?.nurseDate ?? "",
                  hint: '',
                  contentWeight: -1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '通知家属时间',
                  value: detail?.qualityAnomalousEvent?.dependentsDate ?? "",
                  hint: '',
                  contentWeight: -1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '48H内是否送医',
                  value:
                      detail?.qualityAnomalousEvent?.evacuateHospital?.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '48H内是否去世',
                  value: detail?.qualityAnomalousEvent?.passAway?.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '选择通知人',
                  value: detail?.notifer.messageManName,
                  hint: '',
                  contentWeight: -1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              Column(
                children: [
                  TitleValueWidget(
                      title: '入住时跌倒高危险群筛选正确性',
                      value: detail?.qualityAnomalousEvent
                                  ?.falldownScreenCorrectness ==
                              1
                          ? '是'
                          : detail?.qualityAnomalousEvent
                                      ?.falldownScreenCorrectness ==
                                  0
                              ? '其他'
                              : '',
                      hint: '请选择',
                      contentWeight: 1,
                      isRequired: false,
                      arrow: arrowRight,
                      textAlign: TextAlign.end),
                  CommonText(
                          detail?.qualityAnomalousEvent?.screenIncorrectItem ??
                              "")
                      .addToContainer(
                          width: double.infinity,
                          decoration: BoxDecoration(
                              color: Color(0xfff7f7f7),
                              borderRadius: 3.borderRadius),
                          padding: EdgeInsets.symmetric(
                              horizontal: 16, vertical: 12)),
                  SizedBox(
                    height: 14,
                  )
                ],
              ),
              TitleValueWidget(
                  title: '跌倒造成的伤害',
                  value: detail?.qualityAnomalousEvent?.damageLevelName ?? "",
                  hint: '',
                  contentWeight: 2,
                  titleWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleVerticalContent(
                  title: '跌倒发生時长者的受伤部位(可复选)',
                  child: Wrap(
                    spacing: 16,
                    children: [
                      CheckTextItem(
                        title: '头',
                        onChanged: (value) {},
                        fill: false,
                        enable: false,
                        defaultSelected: detail
                                ?.qualityAnomalousEvent?.damageParts
                                ?.contains("1") ==
                            true,
                      ),
                      CheckTextItem(
                        title: '颈部',
                        onChanged: (value) {},
                        fill: false,
                        enable: false,
                        defaultSelected: detail
                                ?.qualityAnomalousEvent?.damageParts
                                ?.contains("2") ==
                            true,
                      ),
                      CheckTextItem(
                        title: '手',
                        onChanged: (value) {},
                        fill: false,
                        enable: false,
                        defaultSelected: detail
                                ?.qualityAnomalousEvent?.damageParts
                                ?.contains("3") ==
                            true,
                      ),
                      CheckTextItem(
                        title: '腿',
                        onChanged: (value) {},
                        fill: false,
                        enable: false,
                        defaultSelected: detail
                                ?.qualityAnomalousEvent?.damageParts
                                ?.contains("4") ==
                            true,
                      ),
                    ],
                  )),
              TitleVerticalContent(
                  title: '造成跌倒的原因',
                  child: Column(
                    children: [
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          CheckTextItem(
                            title: '健康状态',
                            onChanged: (value) {},
                            enable: false,
                            defaultSelected:
                                detail?.qualityAnomalousEvent?.isHealthStatus ==
                                    1,
                          ),
                          SizedBox(
                            height: 12,
                          ),
                          Row(
                            children: [
                              SizedBox(
                                width: 16,
                              ),
                              CheckTextItem(
                                title: '意识不清',
                                onChanged: (value) {},
                                enable: false,
                                defaultSelected: detail
                                        ?.qualityAnomalousEvent?.healthStatus
                                        ?.contains("1") ==
                                    true,
                              ).setWeight(1),
                              CheckTextItem(
                                title: '睡眠不足',
                                onChanged: (value) {},
                                enable: false,
                                defaultSelected: detail
                                        ?.qualityAnomalousEvent?.healthStatus
                                        ?.contains("2") ==
                                    true,
                              ).setWeight(1),
                              CheckTextItem(
                                title: '步态平衡异常',
                                onChanged: (value) {},
                                enable: false,
                                defaultSelected: detail
                                        ?.qualityAnomalousEvent?.healthStatus
                                        ?.contains("3") ==
                                    true,
                              ).setWeight(1),
                            ],
                          ),
                          SizedBox(
                            height: 12,
                          ),
                          Row(
                            children: [
                              SizedBox(
                                width: 16,
                              ),
                              CheckTextItem(
                                title: '血色素低头晕 hb',
                                onChanged: (value) {},
                                enable: false,
                                defaultSelected: detail
                                        ?.qualityAnomalousEvent?.healthStatus
                                        ?.contains("4") ==
                                    true,
                              ).setWeight(2),
                              Row(
                                children: [
                                  CommonText(detail?.qualityAnomalousEvent
                                          ?.healthStatusHemoglobin?.d
                                          .toStringOrNull())
                                      .addToContainer(
                                          decoration: BoxDecoration(
                                              color: Colours.bg_color,
                                              borderRadius: 3.borderRadius),
                                          padding: EdgeInsets.symmetric(
                                              horizontal: 6, vertical: 2))
                                      .setWeight(1),
                                  CommonText('mg/d')
                                ],
                              ).setWeight(3)
                            ],
                          ),
                          SizedBox(
                            height: 12,
                          ),
                          Row(
                            children: [
                              SizedBox(
                                width: 16,
                              ),
                              CheckTextItem(
                                title: '其他',
                                onChanged: (value) {},
                                enable: false,
                                defaultSelected: detail
                                        ?.qualityAnomalousEvent?.healthStatus
                                        ?.contains("5") ==
                                    true,
                              ).setWeight(2),
                              Row(
                                children: [
                                  CommonText(detail?.qualityAnomalousEvent
                                              ?.healthStatusOther ??
                                          "")
                                      .addToContainer(
                                          decoration: BoxDecoration(
                                              color: Colours.bg_color,
                                              borderRadius: 3.borderRadius),
                                          padding: EdgeInsets.symmetric(
                                              horizontal: 6, vertical: 2))
                                      .setWeight(1),
                                ],
                              ).setWeight(3)
                            ],
                          )
                        ],
                      ),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          CheckTextItem(
                            title: '因治疗、药物、麻醉反应',
                            onChanged: (value) {},
                            enable: false,
                            defaultSelected:
                                detail?.qualityAnomalousEvent?.isMedicineCure ==
                                    1,
                          ),
                          SizedBox(
                            height: 12,
                          ),
                          Row(
                            children: [
                              SizedBox(
                                width: 16,
                              ),
                              CheckTextItem(
                                title: '因麻醉因素(麻醉时间及麻醉方式)',
                                onChanged: (value) {},
                                enable: false,
                                defaultSelected: detail
                                        ?.qualityAnomalousEvent?.isNarcotism ==
                                    1,
                              ).setWeight(2),
                              Row(
                                children: [
                                  CommonText(detail?.qualityAnomalousEvent
                                              ?.narcotismDescription ??
                                          "")
                                      .addToContainer(
                                          decoration: BoxDecoration(
                                              color: Colours.bg_color,
                                              borderRadius: 3.borderRadius),
                                          padding: EdgeInsets.symmetric(
                                              horizontal: 6, vertical: 2))
                                      .setWeight(1),
                                ],
                              ).setWeight(3)
                            ],
                          ),
                          SizedBox(
                            height: 12,
                          ),
                          Row(
                            children: [
                              SizedBox(
                                width: 16,
                              ),
                              CheckTextItem(
                                title: '因药物因素',
                                onChanged: (value) {},
                                enable: false,
                                defaultSelected:
                                    detail?.qualityAnomalousEvent?.isMedicine ==
                                        1,
                              ).setWeight(2),
                              Row(
                                children: [
                                  CommonText(
                                          detail?.qualityAnomalousEvent
                                              ?.medicineHours?.medicineHourName,
                                          hintText: '')
                                      .addToContainer(
                                          decoration: BoxDecoration(
                                              color: Colours.bg_color,
                                              borderRadius: 3.borderRadius),
                                          padding: EdgeInsets.symmetric(
                                              horizontal: 6, vertical: 2))
                                      .setWeight(1),
                                ],
                              ).setWeight(3)
                            ],
                          ),
                          SizedBox(
                            height: 12,
                          ),
                          Row(
                            children: [
                              SizedBox(
                                width: 16,
                              ),
                              CheckTextItem(
                                title: '服用药物名',
                                showIcon: false,
                                onChanged: (bool value) {},
                              ).setWeight(2),
                              Row(
                                children: [
                                  CommonText(detail?.qualityAnomalousEvent
                                          ?.medicineDescription)
                                      .addToContainer(
                                          decoration: BoxDecoration(
                                              color: Colours.bg_color,
                                              borderRadius: 3.borderRadius),
                                          padding: EdgeInsets.symmetric(
                                              horizontal: 6, vertical: 2))
                                      .setWeight(1),
                                ],
                              ).setWeight(3)
                            ],
                          )
                        ],
                      ),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          CheckTextItem(
                            title: '环境危险因子',
                            onChanged: (value) {},
                            enable: false,
                            defaultSelected:
                                detail?.qualityAnomalousEvent?.isEnvironment ==
                                    1,
                          ),
                          SizedBox(
                            height: 12,
                          ),
                          Row(
                            children: [
                              SizedBox(
                                width: 16,
                              ),
                              Wrap(
                                children: [
                                  CheckTextItem(
                                    title: '地板湿滑',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.environmentDescription
                                            ?.contains("1") ==
                                        true,
                                  ),
                                  CheckTextItem(
                                    title: '灯光昏暗',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.environmentDescription
                                            ?.contains("2") ==
                                        true,
                                  ),
                                  CheckTextItem(
                                    title: '可扶持药品无法触及',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.environmentDescription
                                            ?.contains("3") ==
                                        true,
                                  ),
                                  CheckTextItem(
                                    title: '有障碍物',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.environmentDescription
                                            ?.contains("4") ==
                                        true,
                                  ),
                                  CheckTextItem(
                                    title: '未提供辅助器具',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.environmentDescription
                                            ?.contains("5") ==
                                        true,
                                  ),
                                  CheckTextItem(
                                    title: '其他',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.environmentDescription
                                            ?.contains("6") ==
                                        true,
                                  ),
                                  CommonText(
                                    detail?.qualityAnomalousEvent
                                        ?.otherEnvironmentDescription,
                                  ).addToContainer(
                                      width: double.infinity,
                                      decoration: BoxDecoration(
                                          color: Color(0xfff7f7f7),
                                          borderRadius: 3.borderRadius),
                                      padding: EdgeInsets.symmetric(
                                          horizontal: 16, vertical: 12)),
                                ].insertWidget(Container(
                                  height: 12,
                                )),
                              ).setWeight(1)
                            ],
                          ),
                        ],
                      ),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          CheckTextItem(
                            title: '设备损坏',
                            onChanged: (value) {},
                            enable: false,
                            defaultSelected:
                                detail?.qualityAnomalousEvent?.isEquipment == 1,
                          ),
                          SizedBox(
                            height: 12,
                          ),
                          Row(
                            children: [
                              SizedBox(
                                width: 16,
                              ),
                              Wrap(
                                children: [
                                  CheckTextItem(
                                    title: '马桶',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.equipmentDescription
                                            ?.contains("1") ==
                                        true,
                                  ),
                                  CheckTextItem(
                                    title: '拐杖',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.equipmentDescription
                                            ?.contains("2") ==
                                        true,
                                  ),
                                  CheckTextItem(
                                    title: '助行器',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.equipmentDescription
                                            ?.contains("3") ==
                                        true,
                                  ),
                                  CheckTextItem(
                                    title: '轮椅',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.equipmentDescription
                                            ?.contains("4") ==
                                        true,
                                  ),
                                  CheckTextItem(
                                    title: '担架',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.equipmentDescription
                                            ?.contains("5") ==
                                        true,
                                  ),
                                  CheckTextItem(
                                    title: '其他',
                                    onChanged: (value) {},
                                    enable: false,
                                    defaultSelected: detail
                                            ?.qualityAnomalousEvent
                                            ?.equipmentDescription
                                            ?.contains("6") ==
                                        true,
                                  ),
                                  CommonText(detail?.qualityAnomalousEvent
                                              ?.equipmentDescriptionOther ??
                                          "")
                                      .addToContainer(
                                          width: double.infinity,
                                          decoration: BoxDecoration(
                                              color: Color(0xfff7f7f7),
                                              borderRadius: 3.borderRadius),
                                          padding: EdgeInsets.symmetric(
                                              horizontal: 16, vertical: 12)),
                                ].insertWidget(Container(
                                  height: 12,
                                )),
                              ).setWeight(1)
                            ],
                          ),
                        ],
                      ),
                    ].insertWidget(SizedBox(
                      height: 12,
                    )),
                  )),
              TitleValueWidget(
                  title: '有无造成损伤',
                  value: detail?.qualityAnomalousEvent?.damage?.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '损伤类型',
                  value: detail?.qualityAnomalousEvent?.damageType
                      ?.comboDataName((viewModel.comboListMap['400007'] ?? [])),
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleInputWidget(
                title: '损伤的具体描述（部位、意识程度等）',
                contentWeight: -1,
                isRow: false,
                hint: '',
                text: detail?.qualityAnomalousEvent?.damageDescription ?? "",
                inEdit: false,
              )
            ].insertWidget(Gaps.dividerLine),
          ).addToContainer(
              decoration: BoxDecoration(
                color: Colors.white,
              ),
              padding: EdgeInsets.symmetric(horizontal: 12)),
          SizedBox(
            height: 12,
          ),
          Column(
            children: [
              TitleValueWidget(title: '查体', value: '', hint: ''),

              TitleInputWidget(
                title: '腋温（°C）',
                isRow: true,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.armpitTemperature ?? "",
                hint: '',
              ),
              TitleInputWidget(
                title: '血压（mmHg)',
                isRow: true,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.bloodPressure ?? "",
                hint: '',
              ),
              TitleInputWidget(
                title: '脉搏（次/分）',
                isRow: true,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.pulse ?? "",
                hint: '',
              ),
              TitleInputWidget(
                title: '呼吸（次/分）',
                isRow: true,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.breathe ?? "",
                hint: '',
              ),
              TitleInputWidget(
                title: '疼痛评估（VAS）',
                isRow: true,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.painVas ?? "",
                hint: '',
              ),
              TitleInputWidget(
                title: '血氧饱和度（%）',
                isRow: true,
                inEdit: false,
                contentWeight: -1,
                text: detail?.qualityAnomalousEvent?.bloodOxygen ?? "",
                hint: '',
              ),
              TitleInputWidget(
                title: '疼痛评估（Algoplus）',
                isRow: true,
                inEdit: false,
                contentWeight: -1,
                text: detail?.qualityAnomalousEvent?.painAlg ?? "",
                hint: '',
              ),

              TitleValueWidget(
                  title: '四肢活动是否异常',
                  value: detail?.qualityAnomalousEvent?.limbs.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleValueWidget(
                  title: '是否使用抗凝剂',
                  value: detail?.qualityAnomalousEvent?.anticoagulant.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),

              TitleInputWidget(
                title: '临床检查及初步诊断',
                isRow: false,
                keyboardType: CommonInputType.text,
                contentWeight: -1,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.diagnosis ?? "",
                hint: '',
              ),
              TitleInputWidget(
                title: '抗凝剂药品名',
                isRow: false,
                keyboardType: CommonInputType.text,
                contentWeight: -1,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.anticoagulantName ?? "",
                hint: '',
              ),
              TitleValueWidget(
                  title: '是否与药源因素相关',
                  value: detail?.qualityAnomalousEvent?.medicinalSource.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
              TitleInputWidget(
                title: '药源性因素的药品',
                isRow: false,
                keyboardType: CommonInputType.text,
                contentWeight: -1,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.medicinalSourceName ?? "",
              ),
              TitleInputWidget(
                title: '措施（现场+多学科讨论）',
                isRow: false,
                keyboardType: CommonInputType.text,
                contentWeight: -1,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.measure ?? "",
              ),
              TitleValueWidget(
                  title: '是否修改护理计划',
                  value: detail?.qualityAnomalousEvent?.nurseType.yesOrNo,
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),

              ///下拉单选，选择“是”时，出现修改日期的填写
              if (detail?.qualityAnomalousEvent?.nurseType == 1)
                TitleValueWidget(
                    title: '修改日期',
                    value: (detail?.qualityAnomalousEvent?.nurseTypeDate ?? "")
                        .changeTime(format: ['yyyy', '-', 'mm', '-', 'dd']),
                    hint: '请选择',
                    contentWeight: -1,
                    isRequired: false,
                    arrow: arrowRight,
                    textAlign: TextAlign.end),

              TitleValueWidget(
                  title: '是否修改个人计划',
                  value: detail?.qualityAnomalousEvent?.single.yesOrNo,
                  hint: '请选择',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),

              ///下拉单选，选择“是”时，出现修改日期的填写
              if (detail?.qualityAnomalousEvent?.single == 1)
                TitleValueWidget(
                    title: '修改日期',
                    value: (detail?.qualityAnomalousEvent?.singleDate ?? "")
                        .changeTime(format: ['yyyy', '-', 'mm', '-', 'dd']),
                    hint: '',
                    contentWeight: -1,
                    isRequired: false,
                    arrow: arrowRight,
                    textAlign: TextAlign.end),
            ].insertWidget(Gaps.dividerLine),
          ).addToContainer(
              decoration: BoxDecoration(
                color: Colors.white,
              ),
              padding: EdgeInsets.symmetric(horizontal: 12)),
          SizedBox(
            height: 24,
          ),
        ],
      ),
    );
  }

  Widget medicineEventDetail() {
    var detail = viewModel.eventDetail;
    return SingleChildScrollView(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          SizedBox(
            height: 8,
          ),
          Column(
            children: [
              TitleValueWidget(
                  title: '长者姓名',
                  value: detail?.customerName ?? "",
                  hint: '',
                  isRequired: true,
                  contentWeight: -1,
                  arrow: arrowRight),
              TitleValueWidget(
                title: '床位号',
                value: detail?.bedNo ?? "",
                hint: '根据老人自动显示',
                contentWeight: -1,
              ),
              TitleValueWidget(
                title: '性别',
                value: detail?.sexName ?? "",
                hint: '根据老人自动显示',
                contentWeight: -1,
              ),
              TitleValueWidget(
                  title: '发生时间',
                  value: detail?.occurrenceTime ?? "",
                  contentWeight: -1,
                  arrow: arrowRight),
              TitleValueWidget(
                  title: '事发时意识状态',
                  value: detail?.qualityAnomalousEvent?.consciousState ?? "",
                  hint: '',
                  contentWeight: -1,
                  arrow: arrowRight),
              TitleInputWidget(
                title: '诊断',
                hint: '',
                text: detail?.qualityAnomalousEvent?.diagnose ?? "",
                inEdit: false,
              ),
              TitleValueWidget(
                  title: '长者活动性',
                  value: detail?.qualityAnomalousEvent?.activityAnalyze
                      .activityAnalyzeName,
                  hint: '',
                  contentWeight: 1,
                  arrow: arrowRight),
              Column(
                children: [
                  TitleValueWidget(
                      title: '发生地点',
                      value: detail?.qualityAnomalousEvent?.occurLocationType
                          .locationName,
                      hint: '',
                      contentWeight: -1,
                      isRequired: true,
                      arrow: arrowRight),
                  if (detail?.qualityAnomalousEvent?.occurLocationType == 5)
                    CommonText(detail?.qualityAnomalousEvent?.occurLocation)
                        .addToContainer(
                            width: double.infinity,
                            decoration: BoxDecoration(
                                color: Color(0xfff7f7f7),
                                borderRadius: 3.borderRadius),
                            padding: EdgeInsets.symmetric(
                                horizontal: 16, vertical: 12)),
                ],
              ),
              Column(
                children: [
                  TitleValueWidget(
                      title: '发现人员',
                      value: detail?.qualityAnomalousEvent?.findStaffType
                          .findStaffTypeName,
                      hint: '',
                      contentWeight: -1,
                      isRequired: true,
                      arrow: arrowRight),
                  if (detail?.qualityAnomalousEvent?.findStaffType == 3)
                    CommonText(detail?.qualityAnomalousEvent?.findStaff)
                        .addToContainer(
                            width: double.infinity,
                            decoration: BoxDecoration(
                                color: Color(0xfff7f7f7),
                                borderRadius: 3.borderRadius),
                            padding: EdgeInsets.symmetric(
                                horizontal: 16, vertical: 12)),
                ],
              ),
              if(detail?.eventType==4)
              Column(
                children: [
                  TitleValueWidget(
                      title: '造成人员',
                      value: detail?.qualityAnomalousEvent?.causePersonType
                          .causePersonTypeName,
                      hint: '',
                      contentWeight: -1,
                      isRequired: true,
                      arrow: arrowRight),
                  if (detail?.qualityAnomalousEvent?.causePersonType == 4)
                    CommonText(detail?.qualityAnomalousEvent?.causePerson)
                        .addToContainer(
                            width: double.infinity,
                            decoration: BoxDecoration(
                                color: Color(0xfff7f7f7),
                                borderRadius: 3.borderRadius),
                            padding: EdgeInsets.symmetric(
                                horizontal: 16, vertical: 12)),
                ],
              ),
              if(detail?.eventType==4)
              Column(
                children: [
                  TitleValueWidget(
                      title: '错误形态类型',
                      value: detail?.qualityAnomalousEvent?.wrongPatternType
                          .wrongPatternTypeName,
                      hint: '',
                      contentWeight: -1,
                      isRequired: false,
                      arrow: arrowRight),
                  if (detail?.qualityAnomalousEvent?.wrongPatternType == 13)
                    CommonText(detail?.qualityAnomalousEvent?.wrongPattern)
                        .addToContainer(
                            width: double.infinity,
                            decoration: BoxDecoration(
                                color: Color(0xfff7f7f7),
                                borderRadius: 3.borderRadius),
                            padding: EdgeInsets.symmetric(
                                horizontal: 16, vertical: 12)),
                ],
              ),
              if(detail?.eventType==4)
              TitleInputWidget(
                title: '应给药名（剂型）',
                text: detail?.qualityAnomalousEvent?.correctDrugName ?? "",
                isRow: true,
                inEdit: false,
                hint: '',
              ),
              if(detail?.eventType==4)
              TitleInputWidget(
                title: '给错药名（剂型）',
                text: detail?.qualityAnomalousEvent?.wrongDrugName ?? "",
                isRow: true,
                inEdit: false,
                hint: '',
              ),
            ].insertWidget(Gaps.dividerLine),
          ).addToContainer(
              decoration: BoxDecoration(
                color: Colors.white,
              ),
              padding: EdgeInsets.symmetric(horizontal: 12)),
          SizedBox(
            height: 12,
          ),
          Column(
            children: [
              TitleInputWidget(
                title: '事件说明（含时间前因及背景描述）',
                isRequired: true,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.eventDescription ?? "",
                hint: '',
              ),
              TitleInputWidget(
                title: '处理情形（含通报主管）',
                isRequired: true,
                inEdit: false,
                text: detail?.qualityAnomalousEvent?.eventDisposal ?? "",
                hint: '',
              ),
              TitleValueWidget(
                  title: '选择通知人',
                  value: detail?.notifer.messageManName,
                  hint: '',
                  contentWeight: -1,
                  isRequired: false,
                  arrow: arrowRight,
                  textAlign: TextAlign.end),
            ],
          ).addToContainer(
              decoration: BoxDecoration(
                color: Colors.white,
              ),
              padding: EdgeInsets.symmetric(horizontal: 12)),
          SizedBox(
            height: 12,
          ),
          Column(
            children: [
              Container(),
              TitleValueWidget(
                  title: '造成药物异常可能因素（可复选）',
                  value: '',
                  hint: '',
                  contentWeight: -1,
                  isRequired: false,
                  padding: EdgeInsets.zero),
              CheckTextItem(
                title: '与工作状态/流程有关',
                onChanged: (value) {},
                enable: false,
                defaultSelected:
                    detail?.qualityAnomalousEvent?.isProcessFactor == 1,
              ),
              CommonText(detail?.qualityAnomalousEvent?.processFactor ?? "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              CheckTextItem(
                title: '与设备器材/药品因素有关',
                onChanged: (value) {},
                enable: false,
                defaultSelected:
                    detail?.qualityAnomalousEvent?.isDeviceDrugFactor == 1,
              ),
              CommonText(detail?.qualityAnomalousEvent?.deviceDrugFactor ?? "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              CheckTextItem(
                title: '与环境因素有关',
                onChanged: (value) {},
                enable: false,
                defaultSelected:
                    detail?.qualityAnomalousEvent?.isEnvirnmentFactor == 1,
              ),
              CommonText(detail?.qualityAnomalousEvent?.deviceDrugFactor ?? "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              CheckTextItem(
                title: '与人员因素有关',
                onChanged: (value) {},
                enable: false,
                defaultSelected:
                    detail?.qualityAnomalousEvent?.isPersonnelFactor == 1,
              ),
              CommonText(detail?.qualityAnomalousEvent?.personnelFactor ?? "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              CheckTextItem(
                title: '与沟通因素有关',
                onChanged: (value) {},
                enable: false,
                defaultSelected:
                    detail?.qualityAnomalousEvent?.isCommunicationFactor == 1,
              ),
              CommonText(
                      detail?.qualityAnomalousEvent?.communicationFactor ?? "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              CheckTextItem(
                title: '与长者生理/疾病/行为因素有关',
                onChanged: (value) {},
                enable: false,
                defaultSelected:
                    detail?.qualityAnomalousEvent?.isElderHealthFactor == 1,
              ),
              CommonText(detail?.qualityAnomalousEvent?.elderHealthFactor ?? "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              CheckTextItem(
                title: '与机构政策及管理因素有关',
                onChanged: (value) {},
                enable: false,
                defaultSelected: detail
                        ?.qualityAnomalousEvent?.isMechanismManagermentFactor ==
                    1,
              ),
              CommonText(detail
                          ?.qualityAnomalousEvent?.mechanismManagermentFactor ??
                      "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              Container()
            ].insertWidget(SizedBox(
              height: 16,
            )),
          ).addToContainer(
              decoration: BoxDecoration(
                color: Colors.white,
              ),
              padding: EdgeInsets.symmetric(horizontal: 12)),
          SizedBox(
            height: 12,
          ),
          Column(
            children: [
              TitleValueWidget(
                  title: '给药异常事件造成的结果',
                  value: detail?.qualityAnomalousEvent?.abnormalResult
                      ?.comboDataName((viewModel.comboListMap['60'] ?? [])),
                  hint: '',
                  contentWeight: 1,
                  isRequired: false,
                  arrow: arrowRight),
            ],
          ).addToContainer(
              decoration: BoxDecoration(
                color: Colors.white,
              ),
              padding: EdgeInsets.symmetric(horizontal: 12)),
          SizedBox(
            height: 12,
          ),
          Column(
            children: [
              Container(),
              TitleValueWidget(
                  title: '改善方案',
                  value: '',
                  hint: '',
                  contentWeight: -1,
                  isRequired: false,
                  padding: EdgeInsets.zero),
              Row(
                children: [
                  CheckTextItem(
                    title: '长者及家属教育',
                    onChanged: (value) {},
                    enable: false,
                    defaultSelected:
                        detail?.qualityAnomalousEvent?.isElderRelationEdu == 1,
                  ).setWeight(1),
                  CommonText(
                      detail?.qualityAnomalousEvent?.elderRelationEduTime)
                ],
              ),
              CommonText(detail?.qualityAnomalousEvent?.elderRelationEdu ?? "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              Row(
                children: [
                  CheckTextItem(
                    title: '护理人员教育',
                    onChanged: (value) {},
                    enable: false,
                    defaultSelected:
                        detail?.qualityAnomalousEvent?.isNurseEdu == 1,
                  ).setWeight(1),
                  CommonText(detail?.qualityAnomalousEvent?.nurseEduTime)
                ],
              ),
              CommonText(detail?.qualityAnomalousEvent?.nurseEdu ?? "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              Row(
                children: [
                  CheckTextItem(
                    title: '修正护理照护计划',
                    onChanged: (value) {},
                    enable: false,
                    defaultSelected:
                        detail?.qualityAnomalousEvent?.isAmendNursePaln == 1,
                  ).setWeight(1),
                  CommonText(detail?.qualityAnomalousEvent?.amendNursePalnTime)
                ],
              ),
              CommonText(detail?.qualityAnomalousEvent?.amendNursePaln ?? "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              Row(
                children: [
                  CheckTextItem(
                    title: '与环境因素有关',
                    onChanged: (value) {},
                    enable: false,
                    defaultSelected:
                        detail?.qualityAnomalousEvent?.isEnvirnmentFactor == 1,
                  ).setWeight(1),
                  CommonText(
                      detail?.qualityAnomalousEvent?.envirnmentFactorTime)
                ],
              ),
              CommonText(detail?.qualityAnomalousEvent?.envirnmentFactor ?? "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              CheckTextItem(
                title: '增强长者观察',
                onChanged: (value) {},
                enable: false,
                defaultSelected:
                    detail?.qualityAnomalousEvent?.isObservationInterval == 1,
              ),
              Row(
                children: [
                  CommonText('原检查时间（小时）',
                          textColor: Colours.gray_99, textSize: 15)
                      .setWeight(2),
                  CommonText(detail?.qualityAnomalousEvent
                              ?.observationOriginalInterval.toStringOrNull()??"")
                      .addToContainer(
                          width: double.infinity,
                          decoration: BoxDecoration(
                              color: Colours.bg_color,
                              borderRadius: 3.borderRadius),
                          padding: EdgeInsets.symmetric(
                              horizontal: 16, vertical: 11))
                      .setWeight(3)
                ],
              ),
              Row(
                children: [
                  CommonText(
                    '改为',
                    textColor: Colours.gray_99,
                    textSize: 15,
                  ).setWeight(2),
                  CommonText(detail
                              ?.qualityAnomalousEvent?.observationNewInterval.toStringOrNull()??"")

                      .addToContainer(
                          width: double.infinity,
                          decoration: BoxDecoration(
                              color: Colours.bg_color,
                              borderRadius: 3.borderRadius),
                          padding: EdgeInsets.symmetric(
                              horizontal: 16, vertical: 11))
                      .setWeight(3)
                ],
              ),
              Row(
                children: [
                  CheckTextItem(
                    title: '其他',
                    onChanged: (value) {},
                    enable: false,
                    defaultSelected:
                        detail?.qualityAnomalousEvent?.isOtherImprovement == 1,
                  ).setWeight(1),
                  CommonText(
                      detail?.qualityAnomalousEvent?.otherImprovementTime)
                ],
              ),
              CommonText(detail?.qualityAnomalousEvent?.otherImprovement ?? "")
                  .addToContainer(
                      width: double.infinity,
                      decoration: BoxDecoration(
                          color: Colours.bg_color,
                          borderRadius: 3.borderRadius),
                      padding:
                          EdgeInsets.symmetric(horizontal: 16, vertical: 11)),
              Container()
            ].insertWidget(SizedBox(
              height: 16,
            )),
          ).addToContainer(
              decoration: BoxDecoration(
                color: Colors.white,
              ),
              padding: EdgeInsets.symmetric(horizontal: 12)),
        ],
      ),
    );
  }

  @override
  Widget buildRootView(BuildContext context, Widget loadingContentWidget) {
    return Scaffold(
      backgroundColor: Colours.bg_color,
      appBar: AppBar(
        title: Text("不良事件详情"),
      ),
      body: loadingContentWidget,
    );
  }

  @override
  FallEventDetailViewModel createViewModel() {
    return FallEventDetailViewModel(context, eventId: widget.eventId);
  }

  @override
  void onRetryClick() {}
}
